home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / system-config-printer / troubleshoot / QueueNotEnabled.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  2KB  |  57 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import cups
  5. from base import *
  6.  
  7. class QueueNotEnabled(Question):
  8.     
  9.     def __init__(self, troubleshooter):
  10.         Question.__init__(self, troubleshooter, 'Queue not enabled?')
  11.         self.label = gtk.Label()
  12.         solution = gtk.VBox()
  13.         self.label.set_line_wrap(True)
  14.         self.label.set_alignment(0, 0)
  15.         solution.pack_start(self.label, False, False, 0)
  16.         solution.set_border_width(12)
  17.         troubleshooter.new_page(solution, self)
  18.  
  19.     
  20.     def display(self):
  21.         answers = self.troubleshooter.answers
  22.         if not answers['cups_queue_listed']:
  23.             return False
  24.         if answers['is_cups_class']:
  25.             queue = answers['cups_class_dict']
  26.         else:
  27.             queue = answers['cups_printer_dict']
  28.         enabled = queue['printer-state'] != cups.IPP_PRINTER_STOPPED
  29.         if enabled:
  30.             return False
  31.         if answers['cups_printer_remote']:
  32.             attrs = answers['remote_cups_queue_attributes']
  33.             reason = attrs['printer-state-message']
  34.         else:
  35.             reason = queue['printer-state-message']
  36.         if reason:
  37.             reason = _("The reason given is: '%s'.") % reason
  38.         else:
  39.             reason = _('This may be due to the printer being disconnected or switched off.')
  40.         text = '<span weight="bold" size="larger">' + _('Queue Not Enabled') + '</span>\n\n' + _("The queue '%s' is not enabled.") % answers['cups_queue']
  41.         if reason:
  42.             text += ' ' + reason
  43.         
  44.         if not answers['cups_printer_remote']:
  45.             text += '\n\n'
  46.             text += _("To enable it, select the 'Enabled' checkbox in the 'Policies' tab for the printer in the printer administration tool.")
  47.             text += ' ' + TEXT_start_print_admin_tool
  48.         
  49.         self.label.set_markup(text)
  50.         return True
  51.  
  52.     
  53.     def can_click_forward(self):
  54.         return False
  55.  
  56.  
  57.